﻿@inherits BasePage

@page "/Dept/List"
<TableGroup>
    <Table TItem="DepartmentTreeModel" @ref="table" ShowLoading="true" IsTree="true"
           ShowToolbar="true" ShowDefaultButtons="true" ShowAddButton="true"
           ShowExtendButtons="true" ShowEditButton="true" ShowDeleteButton="true"
           OnSaveAsync="OnSaveAsync" OnDeleteAsync="OnDeleteAsync"
           ShowSearch="true" ShowAdvancedSearch="false" ShowRefresh="true" IsStriped="true" IsBordered="true"
           IsPagination="true" OnQueryAsync="@OnQueryAsync"  TreeNodeConverter="TreeNodeConverter">

        <TableColumns>
            <TableColumn @bind-Field="@context.Name" />
            <TableColumn @bind-Field="@context.DisplayOrder" />
            <TableColumn @bind-Field="@context.IsEnabled" ComponentType="@typeof(Switch)" />
            <TableColumn @bind-Field="@context.Icon" />
            <TableColumn @bind-Field="@context.Remarks" />
        </TableColumns>
        <RowButtonTemplate Context="obj">
            <TableCellButtonItem Item="obj" Icon="fa fa-info-circle" Text="添加子部门" OnClickWithoutRenderCallback="CreateChildrenDept"></TableCellButtonItem>
        </RowButtonTemplate>
    </Table>
</TableGroup>